home *** CD-ROM | disk | FTP | other *** search
- '$DEFINE DEBUG ''Define for script development/debugging
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
-
- '' This lets us add progman items
-
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE FUNCTION UpdateAutoExec LIB "Setup.dll" (PATH$) AS INTEGER
- DECLARE FUNCTION IsGroupEaseRunning LIB "Setup.dll" AS INTEGER
-
- ''Dialog ID's
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700
- CONST EXITSUCCESSRB = 701
- CONST APPHELP = 900
- CONST MODELESS = 5000
- CONST BADPATH = 6400
-
- CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
- HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
-
- '' Display the logo bitmap
- SetBitmap CUIDLL$, 1
-
- '' read the .INF file
- szInf$ = GetSymbolValue("STF_CWDDIR") + "SETUP.INF"
- ReadInfFile szInf$
-
- '' Make sure the GroupEase is not running first
- i%=IsGroupEaseRunning()
- IF i% <> 0 THEN
- i% = DoMsgBox ("GroupEase must not be running during Setup. Please exit GroupEase then restart Setup.", "Setup", 0)
- END
- END IF
-
- '' query user for location to install to
- DEST$="c:\ge" ''default destination
-
- GETPATH:
- SetSymbolValue "EditTextIn", DEST$
- SetSymbolValue "EditFocus", "END"
- GETPATHL1:
- sz$ = UIStartDlg(CUIDLL$, DESTPATH, "FEditDlgProc", APPHELP, HELPPROC$)
- DEST$ = GetSymbolValue("EditTextOut")
-
- IF sz$ = "CONTINUE" THEN
- IF IsDirWritable(DEST$) = 0 THEN
- GOSUB BADPATH
- GOTO GETPATHL1
- END IF
- UIPop 1
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO GETPATHL1
- ELSEIF sz$ = "BACK" THEN
- GOTO GETPATHL1
- ELSE
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
-
-
- '' specify which files from .INF file should get copied
- SrcDir$ = GetSymbolValue("STF_SRCDIR")
-
- '' Get the application GroupEase and associated stuff
- AddSectionFilesToCopyList "GroupEase", SrcDir$, DEST$
-
- '' Make sure there is available disk space
- '' First param is just left as "extra", because we are not
- '' expanding any existing files (i.e. adding a K or two to the
- '' WIN.INI file. If you use this, add an "Extra" symbol to
- '' the symbol table created by AddListitem.
- '' Second Parameter identifies a symbol table that the
- '' GetCopyListCost function will create for how much space
- '' is used by the files to be copied to hard disk.
- '' Third Parameter identifies a symbol table that the
- '' GetCopyListCost function will create to identify needed
- '' disk space.
-
- lRetVal& = GetCopyListCost ( "Extra", "FileCost", "Needed" )
-
- IF lRetVal& > 0 THEN
- i% = DoMsgBox ("Insufficient Disk Space", "Setup", 0 )
- ClearCopyList
- GOTO GETPATH '' Try another directory
- END IF
-
- AddToBillboardList CUIDLL$, MODELESS, "FModelessDlgProc", 1
-
- SetCopyGaugePosition 100, 100
-
- '' copy the files
- CopyFilesInCopyList
-
- '' Get the .INI files
- AddSectionFilesToCopyList "INIs", SrcDir$, GetWindowsDir()
- SetCopyGaugePosition 100, 100
- CopyFilesInCopyList
-
- '' Get the Windows files
- AddSectionFilesToCopyList "Windows", SrcDir$, GetWindowsDir()
- SetCopyGaugePosition 100, 100
- CopyFilesInCopyList
-
- '' create a progman group
- CreateProgmanGroup "Ethosoft", "", cmoNone
- ShowProgmanGroup "Ethosoft", 1, cmoNone
- CreateProgmanItem "Ethosoft", "GroupEase", MakePath(DEST$,"ge.exe"), "", cmoOverwrite
- CreateProgmanItem "Ethosoft", "CardData Converter", MakePath(DEST$,"cdfconv.exe"), "", cmoOverwrite
- CreateProgmanItem "Ethosoft", "UserName Mapper", MakePath(DEST$,"usrname.exe"), "", cmoOverwrite
- CreateProgmanItem "Ethosoft", "Read Me", MakePath(DEST$,"readme.wri"), "", cmoOverwrite
-
- '' add the Sounds to the WIN.INI section
- CreateIniKeyValue "WIN.INI", "Sounds", "GroupEaseRing", MakePath(DEST$,"GERING.WAV,GroupEase Ring"), cmoNone
- CreateIniKeyValue "WIN.INI", "Sounds", "GroupEaseAlarm", MakePath(DEST$,"GEALRM.WAV,GroupEase Alarm"), cmoNone
-
- '' add our directory to the path if it is not already there
- '' note: return values:
- '' < 0 means error trying
- '' = 0 means path added to autoexec.bat
- '' > 0 means path already had ours in it
- i%=UpdateAutoExec(DEST$)
- IF i% < 0 THEN
- ERR=i%
- ENDIF
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- IF i% = 0 THEN
- dlg% = EXITSUCCESSRB
- ELSE
- dlg% = EXITSUCCESS
- ENDIF
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, call Ethosoft customer support!", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
- BADPATH:
- sz$ = UIStartDlg(CUIDLL$, BADPATH, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO BADPATH
- END IF
- UIPop 1
- RETURN
-
- ASKQUIT:
- sz$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF sz$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF sz$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
- '*************************************************************************
- '**
- '** Purpose:
- '** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '** Arguments:
- '** szDir$ - full directory path (with optional ending "\")
- '** szFile$ - filename to append to directory
- '** Returns:
- '** Resulting fully qualified path name.
- '*************************************************************************
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
-